package com.xsg.printer.core.enums;

import java.awt.*;

public enum FontStyleEnum {
    NORMAL(1, "正常", Font.PLAIN),

    BOLD(2, "加粗", Font.BOLD),

    ITALIC(3, "斜体", Font.ITALIC),

    BOLD_ITALIC(4, "加粗斜体", Font.BOLD + Font.ITALIC),
    ;

    private Integer type;

    private String name;

    private Integer imageValue;

    FontStyleEnum(int type, String name, Integer imageValue) {
        this.type = type;
        this.name = name;
        this.imageValue = imageValue;
    }

    public Integer getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public Integer getImageValue() {
        return imageValue;
    }

    public static FontStyleEnum getEnumByType(Integer type) {
        for (FontStyleEnum value : values()) {
            if(value.getType().equals(type)){
                return value;
            }
        }
        return FontStyleEnum.NORMAL;
    }
}
